package com.gjy.mongo.sp;

import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.List;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2023-01-30 10:36:22
 */
public interface BookRepository extends MongoRepository<Book, String> {

    Book findOneByTitle(String title);

    List<Book> findByAuthor(String author);

    List<Book> findByCategoryOrderByPublishDateDesc(String category, Pageable pageable);
}
